package www.my.imageframecompare;

/**
 * Created by 张英杰 on 2016/8/23.
 */
public class Config {
    public static final String pic_contentProvider = "content://media/external/images/media/15589";
    public static final String pic_contentProvider2 = "content://media/external/images/media/106";
    public static final String pic_SDCard = "/storage/emulated/0/zhongzi/2016-08-23 11:44:29.jpg";
    public static final String pic_SDFile = "file:///storage/emulated/0/zhongzi/2016-08-23%2011%3A44%3A29.jpg";
//    public static final String pic_Internet = "http://image.baidu.com/search/down?tn=download&ipn=dwnl&word=download&ie=utf8&fr=result&url=http%3A%2F%2Fimg.pconline.com.cn%2Fimages%2Fphotoblog%2F8%2F2%2F9%2F2%2F8292470%2F200910%2F4%2F1254596447055.jpg&thumburl=http%3A%2F%2Fimg2.imgtn.bdimg.com%2Fit%2Fu%3D2926261911%2C1275854855%26fm%3D21%26gp%3D0.jpg";
    //volley显示中文命名图片有问题
    public static final String pic_Internet = "http://202.127.42.47:8016/upload/userfile/170215133205745484/食品流通证书.jpg";
    //    file:///storage/emulated/0/zhongzi/2016-10-09 15:52:36.jpeg
//file:///storage/emulated/0/zhongzi/2016-10-09 15:58:51.jpeg

    public static String getFrescoImgUri(String uri) {
        if (!isNullorEmpty(uri) && uri.contains("/storage/") && (!uri.contains("file://"))) {
            return "file://" + uri;
        } else {
            return uri;
        }
    }

    public static Boolean isNullorEmpty(String value) {

        if (value == null) {
            return true;
        } else if (value.toString().trim().equals("")) {
            return true;
        } else {
            return false;
        }
    }
}
